﻿using System;
using System.Web;
using System.Threading;
using Ue.Framework.Web;

namespace Lswweb.Domain.AjaxHandlers
{
    public class LogisticsResult : Ue.Infrastructure.Web.AsyncHandlers.AsyncResult
    {
        public LogisticsResult(AsyncCallback callback, HttpContext context, object state)
            : base(callback, context, state) { }

        public string CalculateShipping()
        {
            var cityId = this.Context.Request.GetQueryValue<int>("cityId");
            var logisticsCompanyId = this.Context.Request.GetQueryValue<int>("logisticsCompanyId");
            var weight = this.Context.Request.GetQueryValue<int>("weight");

            decimal result = AreaExpressDeliveryExpressions.CountExpressFee(cityId, logisticsCompanyId, weight, 0);
            return CurrencyServices.ForamtPrice(result);
        }
    }
}
